package com.learning.code.multithread.keyword.synchronize.method.methodVariables;

/**
 * 1
 */
public class MainTest {


    public static void main(String[] args) {

        HasMethodVariablesClass hasMethodVariablesClass = new HasMethodVariablesClass();
        new Thread(() -> {
            hasMethodVariablesClass.changeNumByName("xiaoming");
        }).start();

        new Thread(() -> {
            hasMethodVariablesClass.changeNumByName("dahuang");
        }).start();
      /*    打印 结果：

         xiaoming set over
         others set over
         dahuang'num is 200
         xiaoming'num is 100*/

        /**
         *  1. 结论： 方法内的变量是线程安全的！
         */


    }
}
